<?php
// +----------------------------------------------------------------------
// | wttai [ WE CAN DO IT JUST THINK IT ]
// +----------------------------------------------------------------------
// | Copyright (c) 2013 http://www.wttai.com All rights reserved.
// +----------------------------------------------------------------------
// | Author: 老司机 <wutongtai@wttai.com> <http://www.wttai.com>
// +----------------------------------------------------------------------

namespace Admin\Widget;
use Think\Controller;

/**
 * 分类widget
 * 用于动态调用分类信息
 */

class ArticleWidget extends Controller{
    public function getSiteList($article_id)
    {
        if ($article_id < 1) {
            return null;
        }
        $site_ids = D('ArticleSite')->where(array('article_id' => $article_id))->getField('site_id', true);
        
        if (!is_array($site_ids)) {
            $site_ids = array();
        }
        
        $site_data = D('Site')->field(true)->select();

        $this->assign('data', $site_data);
        $this->assign('article_id', $article_id);
        $this->assign('site_ids', $site_ids);
        $this->display('Article/site_list'); 
    }
	
}
